package stylistcrm.core.services.user.profile;

/**
 * Created by yanwc on 2016/9/28.
 */
public enum Gender {
    /**
     * 未知
     */
    UNKNOW(0,"未知"),
    /**
     * 男性
     */
    MALE(1,"男"),

    /**
     * 女性
     */
    FEMALE(2,"女");

    private Integer code;

    private String desc;

    private Gender(Integer code,String desc){
        this.code=code;
        this.desc=desc;
    }
    public Integer getCode(){
        return code;
    }

    public String getDesc(){
        return desc;
    }

    public static Gender getEnum(Integer code) {
        for (Gender enumValue : Gender.values()) {
            if (enumValue.getCode().equals(code))
                return enumValue;
        }

        return null;
    }
}
